package b2.config
{
	public class TaskConfig
	{
		//索引
		public var index:int;
		//类型（0, 主线任务; 1, 支线任务; 2, 节日任务）
		public var type:int;
		//任务目标：0, 战役; 1, 收集; 2, 装备; 3, 强化装备; 4, 合成装备; 5, 强化坦克; 6, 合成坦克; 7, 合成勋章
		public var goal:int;
		//任务名称
		public var name:String;
		//任务类型
		public var typeName:String;
		//任务详情
		public var description:String;
		//任务要求
		public var requirement:String;
		//要求等级
		public var requireLevel:int;
		//要求完成的任务索引
		public var requireTaskIndex:int;
		//是否分享新鲜事
		public var feedFlag:Boolean;
		
		//战役类任务
		//战役索引
		public var campIndex:int;
		//要求完成战役次数
		public var campNum:int;
		
		//物品类任务
		//物品索引
		public var objectIndex:int;
		//要求物品品质
		public var objectQuality:int;
		//要求物品个数
		public var objectNum:int;
		
		//前往战役
		public var gotoCampIndex:int;
		//奖励物品
		public var awardObj:Array;
		
		public function TaskConfig(taskXML:XML)
		{
			index = taskXML.index;
			type = taskXML.type;
			goal = taskXML.goal;
			name = taskXML.name;
			typeName = taskXML.typeName;
			description = taskXML.description;
			requirement = taskXML.requirement;
			requireLevel = taskXML.requireLevel;
			requireTaskIndex = taskXML.requireTaskIndex;
			feedFlag = Boolean(parseInt(taskXML.feedFlag));
			if (taskXML.campIndex != undefined)
			{
				campIndex = taskXML.campIndex;
				campNum = taskXML.campNum;
			}
			else
			{
				campIndex = -1;
				campNum = -1;
			}
			if (taskXML.objectIndex != undefined)
			{
				objectIndex = taskXML.objectIndex;
				objectQuality = taskXML.objectQuality;
				objectNum = taskXML.objectNum;
			}
			else
			{
				objectIndex = -1;
				objectQuality = -1;
				objectNum = -1;
			}
			gotoCampIndex = taskXML.gotoCampIndex;
			awardObj = taskXML.awardObj.split(";");
		}

	}
}